import SourceView from "./source_view"
import SourceAndPreviewView from "./source_and_preview"
import { SelectionModel, TextModel } from "../../models"

export class ViewProvider {
    provide(viewMode: string, textModel: TextModel, selectionModel: SelectionModel, viewContainer: HTMLElement) {
        switch (viewMode) {
            case 'source':
                return new SourceView(textModel, selectionModel, viewContainer)
                break;
            case 'source_and_preview':
                return new SourceAndPreviewView(textModel, selectionModel, viewContainer);
                break;
            case 'render':
                return new SourceView(textModel, selectionModel, viewContainer)
                break

        }
    }
}

export default ViewProvider